function bindData(rowData){
	var streetName = rowData.streetName;	
	$('#joblessStreetName').val(streetName);

    $('#unemployedStreetGrid').datagrid({  
        url:'collect/management/getUnemployedStreetList',  
        queryParams:{
			streetName:streetName,
			streetId:""
	    },
		rownumbers:true,
        fit:true,
        fitColumns:true,
        singleSelect:true,
//      nowrap:false,
        striped:true,

        columns:[[
                  {field:'communityName',title:'社区名称',width:100,rowspan:3,align:'center'},
                  {field:'project',title:'项目',width:100,rowspan:3,align:'center'},
                  {title:'当年有就业愿望的登记失业人员',colspan:7,align:'center'}, 
                  {field:'yearRealize',title:'当年实现就业<br />人数',width:100,rowspan:3,align:'center'},    
                  {field:'employmentRate',title:'就业率',width:100,rowspan:3,align:'center'}] ,
                  [
                  {field:'unemployed',title:'小计',width:100,rowspan:2,align:'center'},
                  {field:'priorYear',title:'上年结转',width:100,rowspan:2,align:'center'},    
                  {title:'本年增加',colspan:2,align:'center'},
                  {title:'个人原因减少',colspan:3,align:'center'}],
                  [  
                  {field:'totalYear',title:'小计',width:100,align:'center'},    
                  {field:'totalMonth',title:'本月新增',width:100,align:'center'},
                  {field:'reduceSummary',title:'小计',width:100,align:'center'},    
                  {field:'objReason',title:'因客观原因',width:100,align:'center'},
                  {field:'giveupJob',title:'放弃求职',width:100,align:'center'}
                ]]
    	
    }); 
}

function joblessCommunity(){
	var rowData = $('#unemployedStreetGrid').datagrid('getSelected');
	if(rowData == undefined){
		$.messager.alert('消息','请选择社区');
	}else{
		var isExists = window.mainpage.mainTabs.isExists('失业人员情况汇总表（社区）', 'collect/management/unemployedCollect_community');
	    switch (isExists) {
	        case 0: 
	        	window.mainpage.mainTabs.createTab('失业人员情况汇总表（社区）','collect/management/unemployedCollect_community',
	        		'', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 1: 
	    	    window.mainpage.mainTabs.createTab('失业人员情况汇总表（社区）','collect/management/unemployedCollect_community',
	    	    	'', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 2: 
	    	    window.mainpage.mainTabs.jumpTab('失业人员情况汇总表（社区）', {name: 'bindData', params: rowData}); break;
	        default: break;
	    }
	}
}
/**
 * 失业人员街道汇总信息excel导出
 */
function exportUnemployedStreetList(){
	var joblessStreetName = $('#joblessStreetName').val();
	window.location.href ="collect/excel/exportUnemployedStreetList?streetName=" + joblessStreetName + "&streetId=" + "";
}

